'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {


  async banner() {
    const { ctx } = this;
    const bannerData = await ctx.service.home.banner();
    ctx.body = {
      code: 1,
      data: bannerData,
    };
  }

  async tab() {
    const { ctx } = this;
    const tabData = await ctx.service.home.tab();
    ctx.body = {
      code: 1,
      data: tabData,
    };
  }

  async menu() {
    const { ctx } = this;
    const menuData = await ctx.service.home.menu();
    ctx.body = {
      code: 1,
      data: menuData,
    };
  }


  // async banner() {
  //   const { ctx } = this;
  //   const bannerData = await ctx.service.home.banner();
  //   ctx.body = {
  //     code: 1,
  //     data: bannerData,
  //   };
  // }

  // async menu() {
  //   const { ctx } = this;
  //   const menuData = await ctx.service.home.menu();
  //   ctx.body = {
  //     code: 1,
  //     data: menuData,
  //   };
  // }
}

module.exports = HomeController;
